@extends('layout.member.master')
@section('menu')
    @include('layout.member.show_menu')
@endsection
@section('content')
    <div class="card">
        <div class="card-header">
            {{$user->name}}的关注
        </div>
        <div class="card-body">
            <div class="row">
                @foreach($followers as $follower)
                    <div class="col-4">
                        <div class="card">
                            <div class="card-header">
                                {{$follower['name']}}
                            </div>
                            <div class="card-body text-center">
                                <div class="avatar avatar-xl">
                                    <img src="{{$follower['icon']}}" alt="..." class="avatar-img rounded-circle">
                                </div>
                            </div>
                            @auth()
                                @can('isSub',$follower)
                                    <div class="card-footer">
                                        @if(auth()->user()->isfollowing($follower))
                                            <a href="{{route ('member.follow',$follower)}}" class="btn btn-outline-danger btn-block">取消关注</a>
                                        @else
                                            <a href="{{route ('member.follow',$follower)}}" class="btn btn-outline-success btn-block">关注</a>
                                        @endif
                                    </div>
                                @endcan
                            @endauth
                        </div>
                    </div>
                @endforeach
            </div>


        </div>
        <div class="card-footer text-muted">
            {{$followers->links()}}
        </div>
    </div>
@endsection
